package com.nuhu.controller;

import com.nuhu.service.PackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PackageController {

    private final PackageService packageService;

    @Autowired
    public PackageController(PackageService packageService) {
        this.packageService = packageService;
    }

    @GetMapping("/package/{packageId}")
    public String getPackageNameById(@PathVariable int packageId) {
        return packageService.getPackageNameById(packageId);
    }
}